#include <os/task.h>
#include <pthread.h>
#include <unistd.h>

task_t task_create(task_func_t task_func, const char *name, int stack_size, void *arg, int priority)
{
    pthread_t thread;
    pthread_create(&thread, NULL, (void *(*)(void *))task_func, arg);
    return (task_t)thread;
}

void task_delete(task_t handle)
{
    pthread_cancel((pthread_t)handle);
}

void task_delay(int ms)
{
    usleep(ms * 1000);
}
